package com.android.hedgehog.puzzles;

import android.graphics.Color;

/**
 * All blocks are assumed to be 30 width and 30 height
 * 
 */
public class SeesawBlock2 {
	public int xCoordinate, yCoordinate; // coordinates
	public int xDigitCoordinate, yDigitCoordinate;
	public int blockWeight;// 1,2,3
	public int boardWeight; // -3,-2,-1,1,2,3
	public int value; // blockWeight *boardWeight
	public int boardXOrder; // 0,1...5
	public int boardYOrder; // 0,1..4
	public int color;

	public SeesawBlock2(int position, int weight) {
		boardXOrder = position;
		blockWeight = 1 + (weight / 10);

		if (position < 3)
			boardWeight = position - 3;
		else
			boardWeight = position - 2;

		xCoordinate = 145 + (boardWeight * 40);
		xDigitCoordinate = xCoordinate + 15;

		value = blockWeight * boardWeight;

		/*
		 * if (blockWeight == 4) color = Color.RED; else if (blockWeight == 3)
		 * color = Color.MAGENTA; else if (blockWeight == 2) color = Color.CYAN;
		 * else color = Color.YELLOW;
		 */

		color = Color.rgb(255 - (blockWeight * 25), 255 - (blockWeight * 15), (blockWeight * 25));

	}

	public void setHeight(int yPosition) {
		yCoordinate = 160 + yPosition;
		yDigitCoordinate = (int) ((yCoordinate) + (30 * .77));
	}

}
